package com.bluesky.nettyserver.controller;

import com.bluesky.nettyserver.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/client")
public class ClientController {
    @GetMapping(value = "/test")
    public String smart_lock(@RequestParam(name="info", defaultValue="") String info){
        String data = info;
        synchronized(Data.class) {//-----这里

        }
        Data.setData(info);
        return "hello" + info;
    }
}
